package com.jm.common.bean.base;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;


/**
 * @author kong
 */
@Data
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class PageParam {
    @Schema(defaultValue = "当前页-默认1")
    @Min(1)
    private Long current = 1L;

    @Schema(defaultValue = "每页数量-默认10")
    @Min(1)
    @Max(100)
    private Long size = 10L;

    @Schema(defaultValue = "搜索")
    private String search;

    @Schema(defaultValue = "上一页 传缓存的上一页的第一条数据id")
    private String topFirstId;
    @Schema(defaultValue = "下一页 传当前页最后一条数据id")
    private String currentLastId;

    @Schema(defaultValue = "默认1下一页 0上一页")
    private Boolean nexted = true;


    public PageParam(Long current, Long size) {
        this.current = current;
        this.size = size;
    }
}
